package com.gztms.ordermgnt.pojo.VO;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.gztms.ordermgnt.easyexcel.StatusConverter;
import com.gztms.ordermgnt.easyexcel.TypeConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author Zoey
 * @date 2023/5/2 20:11
 * @Description OrderVO
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@HeadRowHeight(20)
public class OrderVO {

    @ExcelProperty("订单编号")
    @NumberFormat(value = "#")
    @ColumnWidth(25)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    //用户id
    @ExcelProperty("用户账号")
    @ColumnWidth(15)
    private String createdBy;
    @ExcelIgnore
    private Integer attrId;

    @ExcelProperty("用户名")
    private String username;
    @ExcelProperty("景区名")
    @ColumnWidth(15)
    private String attrName;
    //联系方式
    @ExcelProperty("联系方式")
    @ColumnWidth(15)
    private String phone;
    //价格
    @ExcelProperty("价格")
    @NumberFormat("0.00")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private BigDecimal price;
    //人数
    @ExcelProperty("出行人数")
    @ColumnWidth(15)
    private Integer count;
    //状态（0-未支付，1-已支付，2-取消）
    @ExcelProperty(value = "支付状态",converter = StatusConverter.class)
    @ColumnWidth(15)
    private Integer status;
    //类别（0成人、1儿童）
    @ExcelProperty(value = "类型",converter = TypeConverter.class)
    private Integer type;
    //总金额
    @ExcelProperty("总金额")
    @NumberFormat("0.00")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private BigDecimal totalPrice;
    //备注
    @ExcelProperty("备注信息")
    @ColumnWidth(15)
    private String orderDesc;
    //下单时间
    @ExcelProperty("下单时间")
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ColumnWidth(25)
    private Date createTime;
    //出行时间
    @ExcelProperty("预约时间")
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ColumnWidth(25)
    private Date travelTime;

    //付款时间
    @ExcelProperty("支付时间")
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    @ColumnWidth(25)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date payTime;

}
